//
//  UIColor+colorChange.m
//  AStage_shougongke
//
//  Created by 赵磊 on 16/1/17.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UIColor+colorChange.h"

@implementation UIColor (colorChange)
+ (UIColor *)changeColorWithString:(NSString *)string
{
    NSString *str = [string substringWithRange:NSMakeRange(1, 2)];
    UInt64 mac1 =  strtoul([str UTF8String], 0, 16);
    NSInteger num = (NSInteger)mac1;
    NSString *str2 = [string substringWithRange:NSMakeRange(3, 2)];
    UInt64 mac2 =  strtoul([str2 UTF8String], 0, 16);
    NSInteger num2 = (NSInteger)mac2;
    NSString *str3 = [string substringWithRange:NSMakeRange(5, 2)];
    UInt64 mac3 =  strtoul([str3 UTF8String], 0, 16);
    NSInteger num3 = (NSInteger)mac3;
    return [UIColor colorWithRed:num / 255.0 green:num2 / 255.0 blue:num3 / 255.0 alpha:1.0];
}
@end
